package com.zhuss.appconfig;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zhuss.enums.SystemEnum;

@Component
public class SystemCache {
	
	@Autowired
	private LoginCache<String, Object> loginCache;
	
	@Autowired
	private SmallLoginCache<String, Object> smallLoginCache;
	
	@Autowired
	private AppLoginCache<String, Object> appLoginCache;
	
	public static Map<Integer, Cache<String, Object>> map = new HashMap<>();
	
	public Map<Integer, Cache<String, Object>> runFactory() {
		if (map.isEmpty()) {
			map.put(SystemEnum.PC端.key(), loginCache);
			map.put(SystemEnum.小程序.key(), smallLoginCache);
			map.put(SystemEnum.APP.key(), appLoginCache);
		}
		return map;
	}

}
